package application;

/**
 * Wraps the thread class. Adds options to manipulate with thread. 
 * @author Miroslav Vozabal
 */
public abstract class Application {
	private Thread blinker;
	
	/**
	 * Constructor.
	 */
	public Application() {
		blinker = new Thread() {
		    public void run() {
		    	code();				
		    }
		};
	}
	
	/**
	 * Starts thread.
	 */
	public void start() {
		blinker.start();
	}
	
	/**
	 * Stops thread. Using of this deprecated method isn't affect on application.
	 */
	public void stop() {
		blinker.stop();
	}
	
	/**
	 * Sets a priority to application thread.
	 * @param value
	 */
	public void setPriority(int value){
		blinker.setPriority(value);
	}
	
	/**
	 * Implements Application interface.
	 */
	public abstract void code();
	
}
